package test.com.sms.selenium.singlepoint.util;

import org.openqa.selenium.By;

import test.com.sms.selenium.framework.SeleniumPageUtil;
import test.com.sms.selenium.util.SeleniumUtil;

public class SpReportsScorecardFailureAnalysisByMfgPageUtil extends SeleniumPageUtil {
	
	public final static By RSFM_SPAN_CHANGE_SCOPE 	= By.id("ctl44_lblChangeScope");
	// elements under Change Scope
	public final static By RSFM_DIV_RESULTS 		= By.id("ctl44_popFailureAnalysis");
	
	public final static By RSFM_TD_MFG 				= By.xpath("//*[@id='tblResults']//td[text()='Mfg.']");
	public final static By RSFM_TD_MODEL 			= By.xpath("//*[@id='tblResults']//td[text()='Model']");
	public final static By RSFM_TD_DESCRIPTION 		= By.xpath("//*[@id='tblResults']//td[text()='Description']");
//	public final static By RSFM_TD_ADDCNTRCTS 		= By.xpath("//*[@id='tblResults']//td[text()='AddCntrct']");
	public final static By RSFM_TD_BACKUP 			= By.xpath("//*[@id='tblResults']//td[text()='BACKUP']");
	public final static By RSFM_TD_BATTERY 			= By.xpath("//*[@id='tblResults']//td[text()='Battery']");
	public final static By RSFM_TD_CD_ROM 			= By.xpath("//*[@id='tblResults']//td[text()='CD Rom']");
	public final static By RSFM_TD_CONFIGURE 		= By.xpath("//*[@id='tblResults']//td[text()='Configure']");
	public final static By RSFM_TD_CONTROLLER 		= By.xpath("//*[@id='tblResults']//td[text()='Controller']");
	public final static By RSFM_TD_CPUFAULT 		= By.xpath("//*[@id='tblResults']//td[text()='CPUFault']");
	public final static By RSFM_TD_CUSTOMER	 		= By.xpath("//*[@id='tblResults']//td[text()='Customer']");
//	public final static By RSFM_TD_DC_RELO 			= By.xpath("//*[@id='tblResults']//td[text()='']");
//	public final static By RSFM_TD_DEPOT 			= By.xpath("//*[@id='tblResults']//td[text()='']");
	public final static By RSFM_TD_DRIVEERROR	 	= By.xpath("//*[@id='tblResults']//td[text()='DriveError']");
	public final static By RSFM_TD_DRIVEFAIL	 	= By.xpath("//*[@id='tblResults']//td[text()='DriveFail']");
	public final static By RSFM_TD_DRIVEFAULT	 	= By.xpath("//*[@id='tblResults']//td[text()='DriveFault']");
	public final static By RSFM_TD_EMAILALERT	 	= By.xpath("//*[@id='tblResults']//td[text()='EmailAlert']");
	public final static By RSFM_TD_FAILED_NIC 		= By.xpath("//*[@id='tblResults']//td[text()='Failed NIC']");
	public final static By RSFM_TD_FAILEDRAID	 	= By.xpath("//*[@id='tblResults']//td[text()='FailedRAID']");
	public final static By RSFM_TD_FANFAILURE	 	= By.xpath("//*[@id='tblResults']//td[text()='FanFailure']");
	public final static By RSFM_TD_FIRMWARE	 		= By.xpath("//*[@id='tblResults']//td[text()='Firmware']");
	public final static By RSFM_TD_HBA_CARD 		= By.xpath("//*[@id='tblResults']//td[text()='HBA Card']");
	public final static By RSFM_TD_LAPTOP 			= By.xpath("//*[@id='tblResults']//td[text()='Laptop']");
	public final static By RSFM_TD_MEMORY 			= By.xpath("//*[@id='tblResults']//td[text()='Memory']");
	public final static By RSFM_TD_MONITOR	 		= By.xpath("//*[@id='tblResults']//td[text()='Monitor']");
	public final static By RSFM_TD_MOVE_SYS 		= By.xpath("//*[@id='tblResults']//td[text()='Move sys']");
	public final static By RSFM_TD_NOBOOT 			= By.xpath("//*[@id='tblResults']//td[text()='NoBoot']");
	public final static By RSFM_TD_NOCOMMS 			= By.xpath("//*[@id='tblResults']//td[text()='NoComms']");
//	public final static By RSFM_TD_NOISY_UNIT 		= By.xpath("//*[@id='tblResults']//td[text()='']");
//	public final static By RSFM_TD_NOSCREEN 		= By.xpath("//*[@id='tblResults']//td[text()='NoScreen']");
	public final static By RSFM_TD_NOVIDEO 			= By.xpath("//*[@id='tblResults']//td[text()='NoVideo']");
//	public final static By RSFM_TD_PRTQUAL 			= By.xpath("//*[@id='tblResults']//td[text()='PrtQual']");
	public final static By RSFM_TD_PS 				= By.xpath("//*[@id='tblResults']//td[text()='PS']");
//	public final static By RSFM_TD_REM_ASSIST 		= By.xpath("//*[@id='tblResults']//td[text()='Rem Assist']");
	public final static By RSFM_TD_SLOT 			= By.xpath("//*[@id='tblResults']//td[text()='Slot']");
//	public final static By RSFM_TD_STANDBY 			= By.xpath("//*[@id='tblResults']//td[text()='']");
	public final static By RSFM_TD_STUDY 			= By.xpath("//*[@id='tblResults']//td[text()='Study']");
	public final static By RSFM_TD_SYS_BRD 			= By.xpath("//*[@id='tblResults']//td[text()='Sys Brd']");
	public final static By RSFM_TD_SYSCHECK 		= By.xpath("//*[@id='tblResults']//td[text()='SysCheck']");
	public final static By RSFM_TD_SYSCRASH 		= By.xpath("//*[@id='tblResults']//td[text()='SysCrash']");
	public final static By RSFM_TD_SYSERR			= By.xpath("//*[@id='tblResults']//td[text()='SysErr']");
	public final static By RSFM_TD_SYSHUNG 			= By.xpath("//*[@id='tblResults']//td[text()='SysHung']");
	public final static By RSFM_TD_SYSLOGS 			= By.xpath("//*[@id='tblResults']//td[text()='SysLogs']");
	public final static By RSFM_TD_TAPEERR 			= By.xpath("//*[@id='tblResults']//td[text()='TapeErr']");
	public final static By RSFM_TD_UNKNOWN 			= By.xpath("//*[@id='tblResults']//td[text()='Unknown']");
	public final static By RSFM_TD_VISIT 			= By.xpath("//*[@id='tblResults']//td[text()='Visit']");
	public final static By RSFM_TD_TOTAL 			= By.xpath("//*[@id='tblResults']//td[text()='Total']");
	public final static By RSFM_TD_GRAND_TOTAL	 	= By.xpath("//*[@id='tblResults']//td[text()='(Grand Total)']");
	
	public static void enterReportsScorecardFailureAnalysisByMfgPage() {
		SpHomePageUtil.enter();
		SpHomePageUtil.enterReportsDefaultPage();
		SeleniumUtil.click(SeleniumUtil.getCachedElement(SpReportsDefaultPageUtil.RD_LINK_FAILURE_ANALYSIS_BY_MFG_MODEL));
		waitForPageToLoad();
	}
	public static void waitForPageToLoad() {
		SeleniumUtil.selectDefaultContent();
		SeleniumUtil.selectFrame(SpHomePageUtil.HOME_FRAME_CONTENT_NAME);
		SeleniumUtil.selectFrame(SpHomePageUtil.HOME_FRAME_REPORTS_NAME);
		SeleniumUtil.waitOnElements(new By[]{
				RSFM_SPAN_CHANGE_SCOPE
			});
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(RSFM_SPAN_CHANGE_SCOPE));
	}
}
